<?php
/**
 * @version        $Id$
 * @author         master@xuewl.com
 * @copyright      Copyright (c) 2007 - 2014, Chongqing xuewl Information Technology Co., Ltd.
 * @link           http://www.xuewl.com
**/
namespace Api\Controller;
use \Common\Controller\BaseController;
/* 验证码相关 */
class VerifyController extends BaseController
{
	public function _initialize() {
		parent::_initialize();
	}

	/* 创建验证码 */
	public function create() {
		$Verify = new \Think\Verify();
		$Verify->imageW = 100;
		$Verify->imageH = 37;
		$Verify->fontSize = 14;
		$Verify->length = 4;
		$Verify->useNoise = FALSE;
		$Verify->useCurve = FALSE;
		$Verify->fontttf = '4.ttf';
		$Verify->codeSet = '0123456789';
		$Verify->entry();
	}
	
	/*创建带有砸点的验证码*/
	public function verify(){
		$config =    array(   
				 'imageW'       => 90,
				 'imageH'         => 32,
				 'fontSize'       => 12,    // 验证码字体大小    
				 'length'          => 4,     // 验证码位数    
				 'useNoise'     => true, // 关闭验证码杂点
				 'useCurve'     =>false,
				 'fontttf'           =>'5.ttf'
				 );
		$Verify = new \Think\Verify($config);
		$Verify->entry();
	}
}
?>